package it.eg.managedcor.example;

import it.eg.managedcor.impl.AbstractRollbackableTaskExecutor.RollbackOrder;
import it.eg.managedcor.interfaces.RollbackableTask;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.BasicConfigurator;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		BasicConfigurator.configure();
		
		List<TestProcessTask> tasks = new ArrayList<TestProcessTask>();
		
		tasks.add(new Task1());
		tasks.add(new Task2());
		tasks.add(new RollbackTestTask());
		
		TestProcessInput i = new TestProcessInput();
		i.setCounter(0);
		TestProcessOutput o = new TestProcessOutput();
		
		TestProcessSession sd = new TestProcessSession(i,o);
		
		TestProcessRollbackableExecutor ex = new TestProcessRollbackableExecutor(tasks, null, sd, true, RollbackOrder.EXECUTION_ORDER);
		
		ex.executeTasks();
		
	}

}
